﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_Contact_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery(".form").colorbox({ width: "500px", inline: true, href: "#frmAddNew" });
        });
        function closeOverlay() {
            $.colorbox.close();
        }
        function insertUrl(url) {
            $("[id$='txtUrl']").val(url);
            closeOverlay();
        }

        //ShowStatus('warning', 'Thêm mới chuyên mục thất bại.');
    </script>
    <div style="display: none;">
        <div id="frmAddNew" class="overlaypanel">
            <h2>Thêm tài liệu</h2>
            <ul class="fl">
                <li>
                    <label>Tài liệu</label>
                    <br />
                    <asp:TextBox runat="Server" ID="txtName" Width="200" />
                    <asp:CustomValidator runat="Server" ID="valExist" ValidationGroup="new" ControlToValidate="txtName"
                        ErrorMessage="Tài liệu đã tồn tại" Display="dynamic" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="Server" ValidationGroup="new"
                        ControlToValidate="txtName" ErrorMessage="Nhập tên Tài liệu" Display="Dynamic" />
                </li>
                <li>
                    <label>Tài liệu Group</label><br />
                    <asp:DropDownList runat="Server" ID="ddlMenuGroup" Width="200" AppendDataBoundItems="true">
                        <asp:ListItem Value="2">none</asp:ListItem>
                    </asp:DropDownList>
                </li>
                <li>
                    <label>Url</label><br />
                    <asp:TextBox runat="Server" ID="txtUrl" Width="400" />
                </li>
                <li>
                    <label>Icon</label><br />
                    <asp:TextBox runat="Server" ID="txtIconUrl" Width="400" />
                </li>
                <li>
                    <label>Sắp xếp</label><br />
                    <asp:TextBox runat="Server" ID="txtSortIndex" Width="200" />
                </li>
                <li>Tài liệu con của:<br />
                    <asp:DropDownList ID="ddlMenuParent" Width="200" runat="server" AppendDataBoundItems="true">
                        <asp:ListItem Value="0">none</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;&nbsp;&nbsp;&nbsp; Cho phép hiển thị:
                            <asp:CheckBox ID="chkIsActive" runat="server" />
                </li>
            </ul>
            <asp:Button runat="server" ID="btnAdd" ValidationGroup="new" CssClass="btn primary"
                OnClientClick="colorboxDialogSubmitClicked('form', 'frmAddNew');"
                Text="Thêm mới" OnClick="btnAdd_Click" />
            hoặc <a href="#" onclick="closeOverlay();">Hủy</a>
        </div>
    </div>
    <div class="content-box-outer">
        <div class="content-box-right">
            <ul>
                <li><a href="#Add_Edit.aspx" class="new tooltip" title="Thêm nhanh">Trả lời</a></li>
                <li class="content-box-selected"><a href="Menu.aspx">Liên hệ</a></li>
                
            </ul>
        </div>
        <div class="content-box-left">
            <h1>Quản lý Liên hệ

            </h1>
            <%if (Count() == 0)
              { %>
            <div class="info">
                Bạn chưa có liên hệ.
            </div>
            <%}
              else
              { %>
            <div id="Container">

                <div class="tableToolBox">
                    Hiển thị: <a class="current" href="Default.aspx" title="Tất cả">Tất cả </a>
                    | <a href="Default.aspx?IsPublished=False" title="Đã đọc">Đã đọc</a> | <a
                        href="Default.aspx?IsPublished=True" title="Chưa đọc">Chưa đọc</a>
                    <span id="filteredby">Có tất cả <%=Count() %> bản tin được tìm thấy</span>
                    <div class="Pager">
                        <asp:PagingControl ID="PagingControl1" runat="server" PageSize="1" FirstPageText=""
                            LastPageText="" PreviousPageText="" NextPageText="" />
                    </div>
                    <div class="PageSize">
                        <label for="pageSizeTop">
                            Số dòng / trang
                        </label>
                        <select id="pageSizeTop" name="pageSizeTop" onchange="return ChangePageSize(this)">
                            <option value="10" selected="selected">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </div>
                </div>
                <table id="Posts" class="beTable rounded" style="width: 100%">
                    <thead>
                        <tr>
                            <th width="10" style="text-align: center;">
                            </th>
                            
                            <th width="auto">Họ tên
                            </th>
                              <th width="auto">Email
                            </th>
                            <th width="auto">Chủ đề
                            </th>
                            
                            <th width="120">Ngày
                            </th>
                            <th width="120"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="rpt" runat="server">
                            <ItemTemplate>
                                <tr id="{$T.p.Id}" class="simplehighlight">
                                    <td style="text-align: center;">
                                         <span class="readmail-<%#Eval("IsRead").ToString().ToLower() %> tooltip" title=" <%#Eval("IsRead").ToString().ToLower()=="false"?"Đánh dấu đã đọc":"Đánh dấu chưa đọc" %>" onclick="return $.dalatcooking.jsonContactSetIsRead(<%#Eval("ContactID") %>);"></span>
                          
                                    </td>                                   
                                    <td>
                                        <span>
                                            <b><%#Eval("FirstName") %></b></span>
                                    </td>
                                      <td>
                                        <span><%#Eval("Email") %>
                                            <span>
                                    </td>
                                    <td>
                                        <span><%#Eval("Subject") %>
                                            <span>
                                    </td>
                                   
                                    <td>
                                        <span>
                                            <%#Eval("DateCreated","{0:d}") %></span>

                                                     </td>
                                    </td>
                                    <td>
                                        <ul class="rowTools">
                                            <li><a class="toolsAction" href="#"><span class="">Công cụ</span></a>
                                                <ul class="rowToolsMenu">
                                                    <li><a class="editAction" href="Add_Edit.aspx?ContactID=<%#Eval("ContactID") %>">Trả lời</a></li>

                                                    <li><a class="readmail-<%#Eval("IsRead").ToString().ToLower()=="false"?"true":"false" %>" href="#" onclick="return $.dalatcooking.jsonContactSetIsRead(<%#Eval("ContactID") %>);">
                                                        <%#Eval("IsRead").ToString().ToLower()=="false"?" Đã đọc":" Chưa đọc" %>
                                                    </a></li>

                                                    <li><a class="deleteAction" href="#" onclick="return $.dalatcooking.jsonContactDelete(<%#Eval("ContactID") %>);">Xóa</a></li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>

                             
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
                <div class="Pager">
                    <asp:PagingControl ID="PagingControl2" runat="server" PageSize="1" FirstPageText=""
                        LastPageText="" PreviousPageText="" NextPageText="" />
                </div>
                <div class="PageSize">
                    <label for="pageSizeBottom">
                        Bản tin/Trang</label>
                    <select id="pageSizeBottom" name="pageSizeBottom" onchange="return ChangePageSize(this)">
                        <option value="10">10</option>
                        <option value="25" selected="selected">25</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                </div>
            </div>
            <%} %>
        </div>
    </div>
 
</asp:Content>

